import {request} from '@/api/request/index.js'

export default {
	getSwiperList(tabType = '1', callback) {
		uni.showLoading({
			mask:true,
			title:'正在加载模块...'
		})
		request.get({
				data: {
					c: 'Index',
					m: 'GetBannerList',
					Type: '2',
					City: "上海"
				}
			})
			.then(res => {
				let swiperList =[];
				if (res.Status == "ok") {
					swiperList = res.Tag.List;
				}
				if(callback) callback(swiperList)
			})
			.catch(error => {
				if(callback) callback([])
			});
	},
	getIndexList(callback){
		uni.showLoading({
			mask:true,
			title:'正在加载模块...'
		})
		request.get({
				data: {
					c: 'Index',
					m: 'GetIndexCakeList'
				}
			})
			.then(res => {
				let tag ={};
				if (res.Status == "ok") {
					tag = res.Tag;
				}
				if(callback) callback(tag)
			})
			.catch(error => {
				if(callback) callback({})
			});
	}
}
